import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { h } from 'vue';
// const [modal, contextHolder] = Modal.useModal();

export const confirm = (opt:{title:any, content:any}) => {
    return new Promise((resolve, reject) => {
        Modal.confirm({
            title: opt.title,
            icon: h(ExclamationCircleOutlined),
            content: opt.content,
            okText: '确定',
            okType: 'danger',
            cancelText: '取消',
            onOk() {
                resolve('')
            },
            onCancel() {
                reject()
            },
          });
    })
    
  };